package com.tbit.common.entity;

import lombok.Data;

/**
 * 临时通电检查结果
 *
 * @author <a href="mailto:zheng.zebiao@tbit.com.cn">zb</a>
 * @since 2024/12/12
 */
@Data
public class TempPowerCheckResult {
    /**
     * 是否可以临时通电
     */
    private Boolean canTempPower;
    /**
     * 已临时通电次数（用户临时通电次数 + 管理人员临时通电次数）
     */
    private Integer tempPowerCount;
    /**
     * 原因
     */
    private String reason;

    public static TempPowerCheckResult cannotTempPower(String reason) {
        return cannotTempPower(reason, 0);
    }

    public static TempPowerCheckResult cannotTempPower(String reason, Integer tempPowerCount) {
        TempPowerCheckResult result = new TempPowerCheckResult();
        result.canTempPower = false;
        result.tempPowerCount = tempPowerCount;
        result.reason = reason;
        return result;
    }

    public static TempPowerCheckResult canTempPower(Integer tempPowerCount) {
        TempPowerCheckResult result = new TempPowerCheckResult();
        result.canTempPower = true;
        result.tempPowerCount = tempPowerCount;
        return result;
    }
}
